<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app"></div>
    <template id="t1">
      <div>
        <a v-on:click.prevent="say()" href="https://www.bing.com">Bing</a>
        <hr />
        <a @click.prevent="say()" href="https://www.bing.com">Bing</a>
        <hr />
        <input v-bind:value="username" />
        <hr />
        <input :value="username" />
      </div>
    </template>
    <script src="./vue.js"></script>
    <script>
      /*
      v-指令名称:参数.修饰符="表达式"
      - 修饰符：处理事件中的非业务代码
      */
      const vm = new Vue({
        el: "#app",
        template: "#t1",
        data: {
          username: "jack",
        },
        methods: {
          say() {
            alert("hello jack");
          },
        },
      });

      vm.age = 20;
    </script>
  </body>
</html>
